layui.config({
	base : path+"/static/js/custom/module/login/"
}).use(['form','layer'],function(){
	var form = layui.form(),
		layer = parent.layer === undefined ? layui.layer : parent.layer,
		$ = layui.jquery;
	//video背景
	$(window).resize(function(){
		if($(".video-player").width() > $(window).width()){
			$(".video-player").css({"height":$(window).height(),"width":"auto","left":-($(".video-player").width()-$(window).width())/2});
		}else{
			$(".video-player").css({"width":$(window).width(),"height":"auto","left":-($(".video-player").width()-$(window).width())/2});
		}
	}).resize();
	
	//登录按钮事件
	form.on("submit(login)",function(data){
		debugger
		var index = layer.load();
		$.ajax({
			url:path+"/loginSubmit.htm",
			type:"post",
			dataType:"json",
			async:false,
			data:{userName:data.username,password:data.password},
			success:function(data){
				layer.close(index);
				window.location.href = path + data.url;
			},
			error:function(e){
				layer.close(index);
			}
		});
		return false ;
	})
})
